<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关键问题 - 1 - 修改状态</title>
</head>
<body>
    <script>
        let p = new Promise((resolve, reject) => {
            //1. resolve
            // resolve('OK');
            //2. reject
            // reject('Error');
            //3. 抛出错误
            // throw '出问题啦~~';
            //特殊的情况
            setTimeout(() => {
                // throw '出错啦~~'; //  X  这样子是不能改变 promise 的状态的
                // resolve('OK'); //    OK
                // reject('Error'); //  OK
            }, 100);
        });

        console.log(p);
    </script>
</body>
</html>